package com.study.design.model.behaviorPattern.chainOfResponsibility;

import org.junit.Test;

/**
* @Name: Client
* @Description: 责任链模式测试类
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-2-15 下午3:37:01 
* @Version: V1.0
 */
public class Client {
	
	@Test
	public void chainOfResponsibility() {
		//创建审批责任链对象
		Leader director = new Director("张三") ;
		Leader manager = new Manager("李四") ;
		Leader generalManager = new GeneralManager("王五") ;
		//组织责任链对象关系
		director.setNextLeader(manager) ;
		manager.setNextLeader(generalManager) ;
		//员工请假
		LeaveRequest request = new LeaveRequest("小天",34, "去医院看病！") ;
		director.handleRequest(request) ;
	}

}
